Global Index
HTML5 JS API Index > DOM Tutorials & Specs

HTMLButtonElement

Extends HTMLElement.

The button element represents a button labeled by its contents.

Properties
boolean
autofocus
The autofocus IDL attribute must reflect the content attribute of the same name.
boolean
disabled
The disabled IDL attribute must reflect the disabled content attribute.
HTMLFormElement?
form
Reassociateable form-associated elements have a form IDL attribute, which, on getting, must return the element's form owner, or null if there isn't one.
DOMString
formAction
The action IDL attribute must reflect the content attribute of the same name, except that on getting, when the content attribute is missing or its value is the empty string, the document's address must be returned instead. The target IDL attribute must reflect the content attribute of the same name.
DOMString
formEnctype
The action IDL attribute must reflect the content attribute of the same name, except that on getting, when the content attribute is missing or its value is the empty string, the document's address must be returned instead. The target IDL attribute must reflect the content attribute of the same name.
DOMString
formMethod
The action IDL attribute must reflect the content attribute of the same name, except that on getting, when the content attribute is missing or its value is the empty string, the document's address must be returned instead. The target IDL attribute must reflect the content attribute of the same name.
boolean
formNoValidate
The action IDL attribute must reflect the content attribute of the same name, except that on getting, when the content attribute is missing or its value is the empty string, the document's address must be returned instead. The target IDL attribute must reflect the content attribute of the same name.
DOMString
formTarget
The action IDL attribute must reflect the content attribute of the same name, except that on getting, when the content attribute is missing or its value is the empty string, the document's address must be returned instead. The target IDL attribute must reflect the content attribute of the same name.
NodeList
labels
Labelable elements have a NodeList object associated with them that represents the list of label elements, in tree order, whose labeled control is the element in question. The labels IDL attribute of labelable elements, on getting, must return that NodeList object.
DOMString
name
The name IDL attribute must reflect the name content attribute.
DOMString
type
The type IDL attribute must reflect the content attribute of the same name, limited to only known values.
DOMString
validationMessage
The validationMessage attribute must return the empty string if the element is not a candidate for constraint validation or if it is one but it satisfies its constraints; otherwise, it must return a suitably localized message that the user agent would show the user if this were the only form control with a validity constraint problem.
ValidityState
validity
The validity attribute must return a ValidityState object that represents the validity states of the element. This object is live, and the same object must be returned each time the element's validity attribute is retrieved.
DOMString
value
The value and menu IDL attributes must reflect the content attributes of the same name.
boolean
willValidate
The willValidate attribute must return true if an element is a candidate for constraint validation, and false otherwise (i.e. false if any conditions are barring it from constraint validation).
Operations
boolean
checkValidity()
When the checkValidity() method is invoked, if the element is a candidate for constraint validation and does not satisfy its constraints, the user agent must fire a simple event named invalid that is cancelable (but in this case has no default action) at the element and return false.
boolean
reportValidity()
When the reportValidity() method is invoked, if the element is a candidate for constraint validation and does not satisfy its constraints, the user agent must: fire a simple event named invalid that is cancelable at the element, and if that event is not canceled, report the problems with the constraints of that element to the user; then, return false.
void
setCustomValidity(DOMString error)
The setCustomValidity(message), when invoked, must set the custom validity error message to the value of the given message argument.